package touhou.rule;

import touhou.entity.BigBubble;
import touhou.entity.Bubble;
import touhou.entity.Bullet;
import touhou.entity.EnemyTest;
import touhou.entity.Hero;
import touhou.entity.SmallBubble;
import touhou.game.GameUniverse;
import touhou.game.OverlapRulesApplierDefaultImpl;

public class TouhouOverlapRules extends OverlapRulesApplierDefaultImpl {
	protected GameUniverse universe;

	@Override
	public void setUniverse(GameUniverse universe) {
		this.universe = universe;
	}

	public void overlapRule(Bullet b, EnemyTest t) {
		t.damage(b.getDamage());
		if (t.isDead()) {
			universe.removeGameEntity(t.shooter());
			universe.removeGameEntity(t);
		}
		universe.removeGameEntity(b);
	}
	
	public void overlapRule(Bubble b, Hero t) {
		t.damage(b.getDamage());
		universe.removeGameEntity(b);
	}
	
	public void overlapRule(SmallBubble b, Hero t) {
		t.damage(b.getDamage());
		universe.removeGameEntity(b);
	}
	
	public void overlapRule(BigBubble b, Hero t) {
		t.damage(b.getDamage());
		universe.removeGameEntity(b);
	}
}
